package com.webex.ta.hydra.core.processor;

import com.webex.ta.hydra.core.AbstractProcessor;
import com.webex.ta.hydra.core.ParamDescriptor;
import com.webex.ta.hydra.core.Command;

/**
 * Created by Cisco WebEx.
 * User: vegaz
 * Date: 2010-10-12
 * Time: 16:00:37
 */
public class Wait extends AbstractProcessor {
    private static ParamDescriptor[] desc = new ParamDescriptor[1];

    static {
        desc[0] = new ParamDescriptor("time to wait(in second)");
    }

    public ParamDescriptor[] getParamDescriptors(Command cmd) {
        return desc;
    }

    public void process(String... args) {
        int second = 0;
        try {
             second   = Integer.valueOf(args[0]);
        } catch (NumberFormatException ignore) {

        }
        try {
            Thread.sleep(second * 1000);
        } catch (InterruptedException ignore) {

        }
    }
}
